package com.itheima.web.task;

import com.itheima.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class LogTask {

    @Reference
    private AnalysisByDayService analysisByDayService;//注入日志分析的service对象

    //@Scheduled(cron = "* * 0/1 * * *")
    @Scheduled(cron = "0/5 * * * * *") //暂定设置五秒跑一次数据
    public void run(){
        //记录今日日志数据
        analysisByDayService.saveOrUpdate();
    }
}
